package others.swing.p011;

/*学生成绩管理系统 版本T1.0学生类编写*/
public class Student {
    String SName;//姓名
    String SPassword;//密码
    String SID = "";//学号
    String SClass;//班级
    String Scourses[] = new String[3];//课程
    double SGrade[] = new double[3];//成绩


    Student() {
    }//构造函数

    //设置姓名
    public void setSName(String sn) {
        SName = sn;
    }

    //设置学号
    public void setSID(String sid) {
        SID = sid;
    }

    //设置班级
    public void setSClass(String sc) {
        SClass = sc;
    }

    //设置密码
    public void setSPassword(String pwd) {
        SPassword = pwd;
    }

    //设置课程
    public void setCourses(String c1, String c2, String c3) {
        Scourses[0] = c1;
        Scourses[1] = c2;
        Scourses[2] = c3;
    }

    //学生选课
    public void setSGrade(double g1, double g2, double g3) {
        SGrade[0] = g1;
        SGrade[1] = g2;
        SGrade[2] = g3;
    }

    //获得姓名
    public String getSName() {
        return SName;
    }

    //获得密码
    public String getSPassword() {
        return SPassword;
    }

    //获得学号
    public String getSID() {
        return SID;
    }

    //获得班级
    public String getSClass() {
        return SClass;
    }

    //获得已选的课程1
    public String getCourse_1() {
        return Scourses[0];
    }

    //获得已选的课程2
    public String getCourse_2() {
        return Scourses[1];
    }

    //获得已选的课程3
    public String getCourse_3() {
        return Scourses[2];
    }

    public void getCourses() {
        getCourse_1();
        getCourse_2();
        getCourse_3();
    }

    //获得成绩1
    public double getSGrade_1() {
        return SGrade[0];
    }

    //获得成绩2
    public double getSGrade_2() {
        return SGrade[1];

    }

    //获得成绩3
    public double getSGrade_3() {
        return SGrade[2];
    }

    public void getSGrade() {
        getSGrade_1();
        getSGrade_2();
        getSGrade_3();
    }

    //学生查自己的成绩
    public String StudentGrades() {
        return "\n" + Scourses[0] + "：" + SGrade[0] +
                "\n" + Scourses[1] + "：" + SGrade[1] +
                "\n" + Scourses[2] + "：" + SGrade[2];
    }
}